﻿@model IEnumerable<qkview.Models.Board>

@{
    ViewBag.Title = "Board";
}

<h2>Board</h2>
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.URLSlug)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Description)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.IsPrivate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.IsBlocked)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CreatedDate)
        </th>
        <th>
            @*@Html.DisplayNameFor(model => model.UserID)*@ User
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CategoryID)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.URLSlug)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.IsPrivate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.IsBlocked)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CreatedDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.UserProfile.UserName )
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Category.Name)
        </td>
        <td>
            @Html.RouteLink("View", "Note",  new { username = item.UserProfile.UserName, boardurl = item.URLSlug }) |
            @Html.ActionLink((item.IsBlocked.HasValue && item.IsBlocked.Value) ? "Unblock" : "Block", "BlockBoard", new { id=item.BoardID }) 
        </td>
    </tr>
}

</table>
